package com.pingan.haofang.searchcloud.api.query.parser.dbobject.sqlnode;

import java.util.List;

import com.pingan.haofang.searchcloud.api.query.parser.dbobject.SqlNode;
import com.pingan.haofang.searchcloud.api.query.parser.dbobject.SqlNodeType;

@Deprecated
public class JdbcParamNode extends SqlNode {

    private int jdbcParamIndex;

    public JdbcParamNode(int jdbcParamIndex) {
        this.jdbcParamIndex = jdbcParamIndex;
    }

    @Override
    public int getType() {
        return SqlNodeType.JDBC_PARAM;
    }

    @Override
    public Object getValue(Object...params) {
        return params[jdbcParamIndex];
    }

    @Override
    public int getParamCount() {
        return 0;
    }

    @Override
    public List<ColumnNode> getColumns() {
        return null;
    }

    public int getJdbcParamIndex() {
        return jdbcParamIndex;
    }

    @Override
    public String getAlias() {
        return null;
    }

    @Override
    public int getJdbcParamCount() {
        return 1;
    }

    @Override
    public String toString() {
        return "?:" + jdbcParamIndex;
    }
}
